package xuhaijia.lanou3g.autohome.forum.normalforum;
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//                  \./                   \\`.
//        .'//            为什么坚持  想一想当初             \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-.  \\`.
//    .'//.-"                 `-.  |  .-'                 "-. \\`.
//  .'//______.============-..   \ | /   ..-============._______\\`.
//.'//____________________________\|/_____________________________\\`.
// 
//                             

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import xuhaijia.lanou3g.autohome.R;
import xuhaijia.lanou3g.autohome.base.StringValues;

/**
 * Created by 7 on 16/8/19.
 */
public class OrderAdapter extends BaseAdapter {
    Context context;
    String[] order;

    public OrderAdapter(Context context) {
        this.context = context;
    }

    public void setOrder(String[] order) {
        this.order = order;
    }

    @Override
    public int getCount() {
        return order.length;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder = null;
        if (convertView == null) {
            convertView = LayoutInflater.from(context).inflate(R.layout.item_tv, null);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        viewHolder.orderTv.setText(order[position]);
        if (order.length == 15) {
            viewHolder.orderTv.setHeight(90);
        }
        return convertView;
    }

    private class ViewHolder {
        TextView orderTv;

        public ViewHolder(View view) {
            orderTv = (TextView) view.findViewById(R.id.item_order);
        }
    }


}
